package leetcode1;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:咭咭熊
 * Date:2021 - 09 - 07
 * Time:11:34
 */
public class Printimage {
    /*
     *打印用"*"组成的X形图案；
     *规律：i+ j = n - 1;
     * j = n - i - 1;
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int n = scanner.nextInt();
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (i == j) {
                        System.out.print("*");
                    }else if(j == n - i - 1){
                        System.out.print("*");
                    }else {
                        System.out.println(" ");
                    }
                }
                System.out.println();
            }
        }
    }
}
